﻿using System.Xml.Linq;

namespace Unread.Business.Data.Opml
{
    public static class XElementExtensions
    {
        public static string GetValue(this XElement element, string defaultValue = null)
        {
            if (element == null) return defaultValue;

            return element.Value;
        }

        public static string GetValue(this XAttribute attribute, string defaultValue = null)
        {
            if (attribute == null) return defaultValue;

            return attribute.Value;
        }
    }
}
